<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri ="http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../statics/layui/layui.css" type="text/css"/>
<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
<script type="text/javascript"
	src="../statics/js/jquery-1.11.1.min_044d0927.js"></script>
<script type="text/javascript"
	src="../statics/js/jquery.bxslider_e88acd1b.js"></script>

<script type="text/javascript" src="../statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../statics/js/menu.js"></script>

<script type="text/javascript" src="../statics/js/select.js"></script>

<script type="text/javascript" src="../statics/js/lrscroll.js"></script>

<script type="text/javascript" src="../statics/js/iban.js"></script>
<script type="text/javascript" src="../statics/js/fban.js"></script>
<script type="text/javascript" src="../statics/js/f_ban.js"></script>
<script type="text/javascript" src="../statics/js/mban.js"></script>
<script type="text/javascript" src="../statics/js/bban.js"></script>
<script type="text/javascript" src="../statics/js/hban.js"></script>
<script type="text/javascript" src="../statics/js/tban.js"></script>

<script type="text/javascript" src="../statics/js/lrscroll_1.js"></script>


<title>易买网</title>
</head>
<body>
	<!--Begin Header Begin-->
	<div class="soubg">
		<div class="sou">
			<span class="fr"> <span class="fl">你好，请<a
					href="${pageContext.request.contextPath}/pre/Login.jsp">登录</a>&nbsp;
					<a href="${pageContext.request.contextPath}/pre/Regist.jsp"
					style="color:#ff4e00;">免费注册</a>&nbsp; </span> <span class="fl">|&nbsp;关注我们：</span>
				<span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#"
					class="sh2">微信</a>
			</span> <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img
						src="../statics/images/s_tel.png" align="absmiddle" />
				</a>
			</span> </span>
		</div>
	</div>
	<!--End Header End-->
	<!--Begin Login Begin-->
	<div class="log_bg">
		<div class="top">
			<div class="logo">
				<a href="${pageContext.request.contextPath}/pre/index.jsp"><img
					src="../statics/images/logo.png" />
				</a>
			</div>
		</div>
		<div class="regist">
			<div class="log_img">
				<img src="../statics/images/l_img.png" width="611" height="425" />
			</div>
			<div class="reg_c">
				<form id="form" name="form">
					<table border="0"
						style="width:420px; font-size:14px; margin-top:20px;"
						cellspacing="0" cellpadding="0">
						<tr height="50" valign="top">
							<td width="95">&nbsp;</td>
							<td><span class="fl" style="font-size:24px;">注册</span> <span
								class="fr">已有商城账号，<a
									href="${pageContext.request.contextPath}/pre/Login.jsp"
									style="color:#ff4e00;">我要登录</a>
							</span></td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;用户名
								&nbsp;</td>
							<td><input type="text" value="" class="l_user"
								id="loginName" name="loginName" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;密码
								&nbsp;</td>
							<td><input type="password" value="" class="l_pwd"
								id="password" name="password" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;确认密码
								&nbsp;</td>
							<td><input type="password" value="" class="l_pwd"
								id="respass" name="" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;邮箱
								&nbsp;</td>
							<td><input type="text" value="" class="l_email" id="email"
								name="email" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;手机
								&nbsp;</td>
							<td><input type="text" value="" class="l_tel" id="mobile"
								name="mobile" />
							</td>
						</tr>
						<tr height="50">
							<td align="right">真实姓名 &nbsp;</td>
							<td><input type="text" value="" name="userName" class="l_mem" id="userName"
								name="userName" />
							</td>
						</tr>
						<tr height="50">
							<td align="right">身份证号 &nbsp;</td>
							<td><input type="text" name="identityCode" id="shenfenzheng" value="" class="l_num" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;性别
								&nbsp;
								 
							</td>
							<td><input type="radio" name="sex" value="1" id="sex" title="男"/>男
      							 <input type="radio" name="sex" value="0" id="sex" title="女" checked/>女</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td style="font-size:12px; padding-top:20px;"><span
								style="font-family:'宋体';" class="fl"> <label
									class="r_rad"><input type="checkbox" checked/>
								</label><label class="r_txt">我已阅读并接受《用户协议》</label> </span></td>
						</tr>
						<tr height="60">
							<td>&nbsp;</td>
							<td><input type="button" value="立即注册" id="question"
								class="log_btn" />
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<!--End Login End-->
	<!--Begin Footer Begin-->
	<div class="btmbg">
		<div class="btm">
			备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018
			易买网商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
			<img src="../statics/images/b_1.gif" width="98" height="33" /><img
				src="../statics/images/b_2.gif" width="98" height="33" /><img
				src="../statics/images/b_3.gif" width="98" height="33" /><img
				src="../statics/images/b_4.gif" width="98" height="33" /><img
				src="../statics/images/b_5.gif" width="98" height="33" /><img
				src="../statics/images/b_6.gif" width="98" height="33" />
		</div>
	</div>
	<!--End Footer End -->
	<script src="../statics/js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script src="../statics/layui/layui.all.js" type="text/javascript"></script>
	<script>
    $(function(){
    
    function isNull(){
       var $loginname=$("#loginName").val();
       var $password=$("#password").val();
       var $respass=$("#respass").val();
       var $sex=$("#sex").val();
       var $sfz=$("#shenfenzheng").val();
       var $email=$("#email").val();
       var $mobile=$("#mobile").val();
       var $username=$("#userName").val();
       var a=/^1[3578]\d{9}$/;
       var email=/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
       var sfz2=/^4\d{17}$/;
       if($loginname==""){
       	   layer.msg('用户名不能为空!',{icon:0,time:2000},function(){});
       }else if($password==""){
       	   layer.msg('密码不能为空!',{icon:0,time:2000},function(){});
       }else if($password!=$respass){
       	   layer.msg('两次密码必须相同!',{icon:0,time:2000},function(){});
       }else if($email==""){
       	   layer.msg('邮箱不能为空!',{icon:0,time:2000},function(){});
       }else if(!email.test($email)){
           layer.msg('请输入正确的邮箱格式!',{icon:0,time:2000},function(){});
       }else if($mobile==""){
       	   layer.msg('手机号不能为空!',{icon:0,time:2000},function(){});
       }else if(!a.test($mobile)){
       	   layer.msg('手机号必须是11位数字!手机号以13-15-18开头!',{icon:0,time:2000},function(){});
       }else if($username==""){
       	   layer.msg('真实姓名不能为空!',{icon:0,time:2000},function(){});
       }else if($sfz==""){
       	   layer.msg('身份证不能为空!',{icon:0,time:2000},function(){});
       }else if(!sfz2.test($sfz)){
           layer.msg('身份证必须是18位且格式必须正确!',{icon:0,time:2000},function(){});
       }else{
         return true;
       }
    }
     $("#question").click(function(){
      if(isNull()){
       var $data=$("#form").serialize();
          $.ajax({
         "url":"${pageContext.request.contextPath}/UserServlet?opr=add",
         "type":"get",
         "data":$data,
         "dataType":"text",
         "success":function(data){
            if(data=="true"){
              layer.msg('注册成功!',{icon:1,time:2000},function(){});
              location.href="${pageContext.request.contextPath}/pre/Login.jsp";
            }else{
               layer.msg('注册失败!',{icon:2,time:2000},function(){});
            }
         }
       });
        }
       });
   
       
   
      
    });
</script>
</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
